var utils = require('../../../utils/util.js');

Page({
  /**
   * 页面的初始数据
   */
  data: {
  	checked:true,
    content:""
  },
  onShow: function () {
      this.getAgreement();
  },
  getAgreement:function(){
        var that = this;
        var data = {
            url:"/yluser/page/agreement",
            type:2
        };
        utils.request(data).then(function(res){
            if (res.code == 0) {
                that.setData({
                  content:res.data
                })
            }
        });
  },
  agreement:function(e){
  	var that = this;
  	var check = this.data.checked;
  	if (!check) {
  		utils.errMsg("请先阅读注册协议并同意！");
  		return false;
  	}
  	wx.navigateTo({
        url: "/pages/template/reg/index",
    })
  },
  checkboxChange:function(e){
  	this.setData({
  		checked:!this.data.checked
  	});
  }
})
